home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Utilities Experience
/
The Utilities Experience - Volume 1.iso
/
software
/
comms
/
html-heaven
/
arexx
/
html-polyed.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-01-08
|
2KB
|
65 lines
/* HTML-Helper Arexx script for PolyEd 2.0
* Ver : 1.2 (7th January 1996)
* Copyright: Paul Kolenbrander (InterNet: paul@serena.iaehv.nl)
* Function : Pass on the HTML commands from HTML-Helper to PolyEd.
* Detect if block is selected and if so drape tag pairs
* around the block and then deselect it.
* Problems : none.
* Input : HTMLCMD - The HTML command to be inserted.
*/
OPTIONS RESULTS /* enable return codes */
PARSE ARG MYCMD HTMLCMD
HTMLCMD = SUBSTR(HTMLCMD,2, LENGTH(HTMLCMD)-1) /* strip leading space */
/* HTMLCMD = STRIP((TRANSLATE(HTMLCMD,'','\')), B,'"') */
/* Strip quotes at each end. */
ADDRESS "POLYED.1" /* Default, edit if needed */
'LOCKGUI'
'GETATTR' APPLICATION STEM APP. /* Check if block is defined */
BeginLine = APP.VAR_BLOCKSTARTLINE
BeginCol = APP.VAR_BLOCKSTARTCOL
EndLine = APP.VAR_BLOCKENDLINE
EndCol = APP.VAR_BLOCKENDCOL
Current = APP.CURRENTPROJECT
if BeginLine = EndLine & BeginCol = EndCol then
/* Not a block. drop it in. */
'TEXT' HTMLCMD /* Insert at current pos. */
else do
if POS('><',HTMLCMD) ~= 0 then do /* Is it a split command? */
/* If yes, then.... */
CMD2 = right(HTMLCMD,(LENGTH(HTMLCMD)-(LASTPOS('<',HTMLCMD))+1))
CMD1 = substr(HTMLCMD,1,(LENGTH(HTMLCMD)-LENGTH(CMD2)))
CMD1 = CMD1||'"'
CMD2 = '"'||CMD2
'GOTOLINE' EndLine + 1 /* Move to end and put 2nd */
'GOTOCOLUMN' EndCol + 1
'TEXT' CMD2
'GOTOLINE' BeginLine + 1 /* Move to start and put 1st */
'GOTOCOLUMN' BeginCol + 1
'TEXT' CMD1
end
else
'TEXT' HTMLCMD /* Insert at current pos. */
'BLOCK FORGET'
end
IF MYCMD = 'SAVE' THEN DO
'SAVE'
'GETATTR' PROJECT NAME current STEM PR.
bestand = PR.FILENAME
IF bestand = '' | bestand = 'BESTAND' THEN DO
ADDRESS COMMAND 'rx S:HTMLVIEW.rexx'
END
ELSE DO
ADDRESS COMMAND 'rx S:HTMLVIEW.rexx '||bestand
END
END
'UNLOCKGUI'
EXIT /* And exit the script. */